package com.ruoyi.business.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.business.mapper.BookTimeMapper;
import com.ruoyi.business.domain.BookTime;
import com.ruoyi.business.service.IBookTimeService;

/**
 * 规定时间段Service业务层处理
 * 
 * @author liwenjing
 * @date 2021-05-20
 */
@Service
public class BookTimeServiceImpl implements IBookTimeService 
{
    @Autowired
    private BookTimeMapper bookTimeMapper;

    /**
     * 查询规定时间段
     * 
     * @param id 规定时间段ID
     * @return 规定时间段
     */
    @Override
    public BookTime selectBookTimeById(Long id)
    {
        return bookTimeMapper.selectBookTimeById(id);
    }

    /**
     * 查询规定时间段列表
     * 
     * @param bookTime 规定时间段
     * @return 规定时间段
     */
    @Override
    public List<BookTime> selectBookTimeList(BookTime bookTime)
    {
        return bookTimeMapper.selectBookTimeList(bookTime);
    }

    /**
     * 新增规定时间段
     * 
     * @param bookTime 规定时间段
     * @return 结果
     */
    @Override
    public int insertBookTime(BookTime bookTime)
    {
        bookTime.setSelectTime(bookTime.getStartTime()+"-"+bookTime.getEndTime());
        return bookTimeMapper.insertBookTime(bookTime);
    }

    /**
     * 修改规定时间段
     * 
     * @param bookTime 规定时间段
     * @return 结果
     */
    @Override
    public int updateBookTime(BookTime bookTime)
    {
        return bookTimeMapper.updateBookTime(bookTime);
    }

    /**
     * 批量删除规定时间段
     * 
     * @param ids 需要删除的规定时间段ID
     * @return 结果
     */
    @Override
    public int deleteBookTimeByIds(Long[] ids)
    {
        return bookTimeMapper.deleteBookTimeByIds(ids);
    }

    /**
     * 删除规定时间段信息
     * 
     * @param id 规定时间段ID
     * @return 结果
     */
    @Override
    public int deleteBookTimeById(Long id)
    {
        return bookTimeMapper.deleteBookTimeById(id);
    }
}
